﻿using System;
using System.IO;
using Microsoft.Win32;

namespace SteamTools
{
    internal class SteamStrings
    {
        internal static String SteamApps = "SteamApps";
        internal static String Common = "Common";
        internal static String RegKey = "HKEY_CURRENT_USER\\Software\\Valve\\Steam";
        internal static String RegValue = "SteamPath";
        internal static String DownloadURL = "http://store.steampowered.com/about";
    }
    
    internal class SteamFolders
    {
        internal static String Steam
        {
            get
            {
                return (string)Registry.GetValue(SteamStrings.RegKey, SteamStrings.RegValue, null);
            }
        }

        internal static String SteamApps
        {
            get
            {
                if (Steam!=null)
                    return Path.Combine(Steam, SteamStrings.SteamApps);
                else
                    return null;
            }
        }

        internal static String Common
        {
            get
            {
                if (SteamApps!=null)
                    return Path.Combine(SteamApps, SteamStrings.Common);
                else
                    return null;
            }
        }

        internal static String[] CommonGameFolders
        {
            get
            {
                try
                {
                    return Directory.GetDirectories(Common);
                }
                catch
                {
                    return null;
                }
            }
        }
    }
}